<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" th:with="title='管理中心',active='home'">
<header th:replace="back/header::headerFragment(${title},${active})"></header>
<body class="fixed-left">
<div id="wrapper">
    <div th:replace="back/header::header-body"></div>
    <div class="content-page">
        <div class="content">
            <div class="container">
                <div class="row" style="margin-bottom: 20px;">
                    <div class="col-sm-12" style="display: flex; align-items: center;">
                        <img th:src="@{/assets/img/me.jpg}" alt="admin" class="img-circle" style="width:60px;height:60px;margin-right:20px;box-shadow:0 2px 8px #bbb;">
                        <div>
                            <h3 style="margin:0;">欢迎回来，管理员！</h3>
                            <span style="color:#888;">祝你工作愉快，管理高效！</span>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-6">
                        <div class="mini-stat clearfix bx-shadow bg-info" style="border-radius:12px;box-shadow:0 2px 8px #b3e5fc;margin-bottom:20px;">
                            <span class="mini-stat-icon" style="font-size:32px;"><i class="fa fa-file-text" aria-hidden="true"></i></span>
                            <div class="mini-stat-info text-right">
                                <span class="counter" th:text="${statistics.articles}" style="font-size:28px;"></span><br>文章总数
                            </div>
                        </div>
                        <div class="panel panel-default" style="border-radius:10px;box-shadow:0 2px 8px #eee;">
                            <div class="panel-heading" style="background:#f5f5f5;border-radius:10px 10px 0 0;">
                                <h4 class="panel-title"><i class="fa fa-newspaper-o"></i> 最新文章</h4>
                            </div>
                            <div class="panel-body" style="max-height:420px;overflow:auto;">
                                <ul class="list-group">
                                    <li class="list-group-item" th:each="article : ${articles}">
                                        <span class="badge badge-primary" th:text="${article.commentsNum}"></span>
                                        <a target="_blank" th:href="${commons.site_url('/article/')}+${article.id}" th:text="${article.title}"></a>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="mini-stat clearfix bg-purple bx-shadow" style="border-radius:12px;box-shadow:0 2px 8px #e1bee7;margin-bottom:20px;">
                            <span class="mini-stat-icon" style="font-size:32px;"><i class="fa fa-comments-o" aria-hidden="true"></i></span>
                            <div class="mini-stat-info text-right">
                                <span class="counter" th:text="${statistics.comments}" style="font-size:28px;"></span><br>留言总数
                            </div>
                        </div>
                        <div class="panel panel-default" style="border-radius:10px;box-shadow:0 2px 8px #eee;">
                            <div class="panel-heading" style="background:#f5f5f5;border-radius:10px 10px 0 0;">
                                <h4 class="panel-title"><i class="fa fa-commenting-o"></i> 最新留言</h4>
                            </div>
                            <div class="panel-body" style="max-height:420px;overflow:auto;">
                                <div th:if="${comments.size()}==0">
                                    <div class="alert alert-warning">还没有收到留言.</div>
                                </div>
                                <ul class="list-group" th:unless="${comments}==null and ${comments.size()}==0">
                                    <li class="list-group-item" th:each="comment : ${comments}">
                                        <th:block th:text="${comment.author}"/> 于 <th:block th:text="${commons.dateFormat(comment.created)}"/>：
                                        <a th:href="${commons.site_url('/article/')}+${comment.articleId}+'#comments'" target="_blank" th:utext="${commons.article(comment.content)}"></a>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
                <div th:replace="back/footer :: footer-content"></div>
            </div>
        </div>
    </div>
</div>
<div th:replace="back/footer :: footer"></div>
</body>
</html>